package com.viking.controller;

import com.viking.feign.StockFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private RestTemplate restTemplate;

    @Autowired
    private StockFeignService stockFeignService;

    @RequestMapping("/add/{id}")
    public String add(@PathVariable Integer id){
        System.out.println("进入下单！");
        String result = stockFeignService.reduce2();
        return "结果返回："+result;
    }
}
